home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nejlepší hry
/
Nejlepsi hry.iso
/
hry
/
sea of chaos
/
sea_install.msi
/
_15C39AAA7726369D39812BD40F01CF6A
/
_AB12518E6D164E2D9D9FE27064092C09
< prev
next >
Wrap
Text File
|
2004-12-03
|
870b
|
45 lines
//sample texture, and make a tiny part of it "shine" based on distance froma given point
//Luke Lenhart
//(C)2004-2005 Digipen Institute of Technology
//cloud sampler
sampler2D sampTex;
//shader input
struct PS_INPUT
{
float3 Pos : TEXCOORD1;
float2 Tex0 : TEXCOORD0;
float4 Color : COLOR;
};
//things within a certain distance of this will "shine"
float2 point;
//distance from point at which shine occurs
float tarDist;
//shader code
float4 PShader(PS_INPUT In) : COLOR
{
//sample textutes
float4 texclr=tex2D(sampTex,In.Tex0);
//blend with vert color
float4 clr=texclr*In.Color;
//calc shiny mod
float curDist=abs(tarDist-distance(In.Pos.xy,point.xy));
float mod=1.0f;
if (curDist<2.0)
{
mod=4.0f - curDist*2.0f;
mod=1.0f + 0.5f*mod;
}
clr.xyz*=mod;
//spit out color
return clr;
}